package cn.zhf.shop.service.impl;

import cn.zhf.shop.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import cn.zhf.shop.mapper.PublicityPicturesMapper;
import java.util.List;
import cn.zhf.shop.entity.PublicityPictures;
import cn.zhf.shop.service.PublicityPicturesService;
@Service
public class PublicityPicturesServiceImpl implements PublicityPicturesService{

    @Resource
    private PublicityPicturesMapper publicityPicturesMapper;

    @Override
    public Message deleteByPrimaryKey(Integer publicityPicturesId) {
        return publicityPicturesMapper.deleteByPrimaryKey(publicityPicturesId)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message insert(PublicityPictures record) {
        return publicityPicturesMapper.insert(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message insertSelective(PublicityPictures record) {
        return publicityPicturesMapper.insertSelective(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message<PublicityPictures> selectByPrimaryKey(Integer publicityPicturesId) {
        return Message.success(null).add(publicityPicturesMapper.selectByPrimaryKey(publicityPicturesId));
    }

    @Override
    public Message updateByPrimaryKeySelective(PublicityPictures record) {
        return publicityPicturesMapper.updateByPrimaryKeySelective(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(PublicityPictures record) {
        return publicityPicturesMapper.updateByPrimaryKey(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message<List<PublicityPictures>> selectAll() {
        return Message.success(null).add(publicityPicturesMapper.selectAll());
    }

    @Override
    public Message<List<PublicityPictures>> selectByPublicityPicturesGroup(Integer publicityPicturesGroup) {
        return Message.success(null).add(publicityPicturesMapper.selectByPublicityPicturesGroup(publicityPicturesGroup));
    }

    @Override
    public Message updatePublicityPicturesOrderByPublicityPicturesId(Integer updatedPublicityPicturesOrder, Integer publicityPicturesId) {
        return publicityPicturesMapper.updatePublicityPicturesOrderByPublicityPicturesId(updatedPublicityPicturesOrder, publicityPicturesId)>0?Message.success(null):Message.fail(null);
    }

}
